<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
	</body>
	<script>
		//189000401 邓玉石
		let code = prompt("请输入行数：");
	
		//三角形开始---------------------------------------------------------------------------------------------------//
		for(let i = 1; i <= code; i++){
		    for(let j = 1; j <= code - i; j++){
		        document.write("&nbsp;");
		    }
		    for(let m = 1; m <= 2 * i - 1; m++){
				if (m % 2 != 0)
					document.write("*");
				else
					document.write("&nbsp;");
		    }
			document.write("<br/>");
		}

		//平行四边形开始-----------------------------------------------------------------------------------------------//
		for (let i = code; i > 0; i--) {
			for (let j = 1; j <= i - 1; j++) {
				document.write("&nbsp;");
			}
			for (let k = 1; k <= 10; k++) {
				if(k % 2 != 0)
					document.write("*");
				else 
					document.write("&nbsp;");
			}
			document.write("<br/>");
		}
		
		//菱形开始----------------------------------------------------------------------------------------------------//
		let max = code;
		for (let i = 1; i <= max; i += 2) {
			for (let j = 1; j <= max - i; j++) {
				document.write("&nbsp;");
			}
			for (let m = 1; m <= 2 * i - 1; m++) {
				if (m % 2 != 0)
					document.write("*");
				else
					document.write("&nbsp;");
			}
			document.write("<br/>");
		}
		for (let i = max - 2; i >= 0; i -= 2) {
			for (let j = 1; j <= max - i; j++) {
				document.write("&nbsp;");
			}
			for (let m = 1; m <= 2 * i - 1; m++) {
				if (m % 2 != 0)
					document.write("*");
				else
					document.write("&nbsp;");
			}
			document.write("<br/>");
		}
		//菱形结束----------------------------------------------------------------------------------------------------//
		
	</script>
	<div class="button"><a href="../index.html">返回首页</a></div>
</html>
